<%--@elvariable id="webRoot" type="com.doupi.partner.op.interceptor.OpFilter"--%>
<%--@elvariable id="type" type="com.doupi.partner.op.controller.partner.PartnerController.index"--%>
<%--@elvariable id="partnerRelation" type="com.doupi.partner.service.dto.PartnerRelationDto"--%>
<%--@elvariable id="cities" type="java.util.List"--%>

<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="../common/tags.jsp" %>

<!DOCTYPE html>
<html>
<head lang="en">
    <%@include file="../common/assets.jsp" %>
</head>
<body>
<!-- header -->
<%@include file="../common/header.jsp" %>

<!-- main start -->
<div class="am-cf admin-main">
    <!-- sidebar start -->
    <%@include file="../common/menu.jsp" %>
    <!-- sidebar end -->

    <!-- main start -->
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">合伙人</strong> /
                    <small>编辑${util:getPartnerTypeByCode(type).name}</small>
                </div>
            </div>

            <hr>
            <form action="${webRoot}/partner/${type}/save" method="POST" id="administrator-edit-form">
                <input type="hidden" name="id" value="${partnerRelation.id}">
                <input type="hidden" name="type" value="<c:out value="${partnerRelation.type}" default="${type}" />">
                <input type="hidden" name="administratorId" value="${partnerRelation.administratorId}">

                <div class="am-tabs am-margin" data-am-tabs="">
                    <ul class="am-tabs-nav am-nav am-nav-tabs">
                        <li class="am-active">
                            <a href="#tab-base-info">基本信息</a>
                        </li>
                    </ul>

                    <div class="am-tabs-bd" style="touch-action: pan-y; -webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">

                        <%--基本信息--%>
                        <div class="am-tab-panel am-in am-active am-form" id="tab-base-info">
                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">手机号：</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <input type="text" class="am-input-sm" name="mobile"
                                            value="${partnerRelation.administrator.mobile}" placeholder="请输入手机号">
                                </div>
                            </div>

                            <div class="am-g am-margin-top">
                                <div class="am-u-sm-4 am-u-md-2 am-text-right">姓名：</div>
                                <div class="am-u-sm-8 am-u-md-10">
                                    <input type="text" class="am-input-sm" name="name"
                                            value="${partnerRelation.administrator.name}" placeholder="请输入姓名">
                                </div>
                            </div>


                            <c:choose><%-- 城市合伙人 分站 总站 --%>

                                <c:when test="${type eq 3 or type eq 4 or type eq 5}">
                                    <div class="am-g am-margin-top">
                                        <div class="am-u-sm-4 am-u-md-2 am-text-right">城市：</div>
                                        <div class="am-u-sm-8 am-u-md-10">
                                            <label style="width: 100%;">
                                                <select class="am-input-sm" name="city">
                                                    <c:forEach items="${cities}" var="city">
                                                        <option value="${city.key}"
                                                                <c:if test="${city.key == partnerRelation.city}">selected</c:if>>${city.value}</option>
                                                    </c:forEach>
                                                </select>
                                            </label>
                                        </div>
                                    </div>
                                </c:when>

                                <c:otherwise>
                                    <input type="hidden" name="city" value="${partnerRelation.city}">
                                </c:otherwise>

                            </c:choose>


                        </div>
                    </div>
                </div>

                <div class="am-margin">
                    <button type="submit" class="am-btn am-btn-primary am-btn-xs">保存</button>
                    <button type="button" class="am-btn am-btn-primary am-btn-xs" onclick="history.go(-1)">关闭</button>
                </div>
            </form>
        </div>

    </div>

</div>
<!-- main end -->

<!-- foot -->
<%@ include file="../common/footer.jsp" %>
</body>
</html>